import { Button, Toast, Pagination } from '@douyinfe/semi-ui';
import en_GB from '@douyinfe/semi-ui/lib/es/locale/source/en_GB';
import { AnyAction } from '@reduxjs/toolkit';
import { useEffect, useState } from 'react';
import { useDispatch } from 'react-redux';
import { shallowEqual, useSelector } from 'react-redux';
import { useBaseConfig } from '../providers/base-config';
// import { persistToken } from '../redux/auth/auth-actions';
import { IRootReducerState } from '../store/root-reducer';
import React from 'react';

const Test = () => {
  // const { baseState } = useSelector<IRootReducerState, any>(
  //   (state) => ({ baseState: state.base }),
  //   shallowEqual
  // );
  // const { value } = baseState;
  const dispatch = useDispatch<any>();

  const [msg, setMsg] = useState('');

  const config = useBaseConfig();
  

  return (
    <div>
      {msg}
      <div>
        <Button
          onClick={() => {
            Toast.warning({ content: 'welcome' });
            // dispatch(actions.increment(1)).then((res: any) => {
            //   console.log(res);
            // });
          }}>
          {/* Hello Semi {value} */}
        </Button>
        <Button
          onClick={() => {
            // dispatch(persistToken('token token')).then((res: any) => {
            //   console.log(res);
            // });
          }}>
          token
        </Button>
        <Button onClick={() => config.setLocale(en_GB)}>locale</Button>
        <Pagination total={100} showTotal showSizeChanger />

        <h1 className='text-3xl font-bold underline'>Hello world!</h1>
      </div>
    </div>
  );
};

export default Test;
